/*
 * @Descripttion: 入口
 * @version: 
 * @Author: 
 * @Date: 2022-04-25 11:40:02
 * @LastEditors: weidelong
 * @LastEditTime: 2022-05-07 14:55:06
 */
const express = require("express");
const app = new express();
const path = require("path");
const jwt = require("./jwt/jwt.js")
/* 路由导入 */
const loginRouter = require('./route/loginRouter')
const loginRouter_mobile = require('./route/loginRouter_mobile')
const userMageRouter = require('./route/userMageRouter')
const articleMange = require('./route/articleMange')
const socialRouter_mobile = require('./route/socialRouter_mobile')
const consultRouter_mobile = require('./route/consultRouter_mobile')
const mine_mobile = require('./route/mine_mobile')
const messageRouter = require('./route/messageRouter')
const homeRouter = require('./route/homeRouter')

/* 静态资源（告诉服务静态资源位置） */
app.use('/public', express.static(path.join(__dirname, './static')))

/* post解析 */
app.use(express.json())
app.use(express.urlencoded({extended: false}))

/* 路由使用 */
app.use(loginRouter)
app.use(userMageRouter)
app.use(articleMange)
app.use(socialRouter_mobile)
app.use(loginRouter_mobile)
app.use(consultRouter_mobile)
app.use(mine_mobile)
app.use(messageRouter)
app.use(homeRouter)

app.listen(3000, () => {
	console.log("服务器启动成功了，可以通过http://127.0.0.1:3000访问");
})
